<script setup lang="ts">
    // //子传父
    let childName1="baby" //要传的属性
    let childName2="Allen"
    let childName3="Walter"
    let product={
        proId:101,
        proName:"手机壳",
        proPrice:29
    }
    let arr=[
        {
            proId:101,
            proName:"手机壳",
            proPrice:29
        },
        {
            proId:102,
            proName:"电风扇",
            proPrice:129
        },
    ]
    //先定义要传的key
    let emit=defineEmits(["childkeyA","childkeyB","childkeyC","childkeyD" ,"childkeyE"])
    const sendMsgToParent=()=>{
        emit("childkeyA",childName1) //向父组件 发送的k-v
        emit("childkeyB",childName2)
        emit("childkeyC",childName3)
        emit("childkeyD",product)
        emit("childkeyE",arr)
    }
</script>

<template>
    <div>
         <button @click="sendMsgToParent">传给父组件</button>
        
    </div>
</template>